import {createApp} from 'vue'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import App from './App.vue'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import router from "./router";
import {createPinia} from 'pinia'
import piniaPluginPersistedState from 'pinia-plugin-persistedstate'
import {SHA256_Encrypt} from "./utils/crypto.ts";
import NProgress from "nprogress";
import "nprogress/nprogress.css";

NProgress.configure({
    easing: 'ease',
    speed: 500,
    trickleSpeed: 200,
    showSpinner: false,
    minimum: 0.2
});

const app = createApp(App)
let pinia = createPinia();
pinia.use(piniaPluginPersistedState)

for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
}
app.use(ElementPlus)
app.use(router)
app.use(pinia)
app.config.globalProperties.$Encrypt = SHA256_Encrypt
app.mount('#app')
